home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr05 / xnot12a.zip / INDENT.C < prev    next >
C/C++ Source or Header  |  1993-05-20  |  619b  |  43 lines

  1. #include "jam.h"
  2. #include "def.h"
  3.  
  4. /* Work function to compute indent of an existing line
  5. */
  6. int indentofline(n, lp)
  7. int n;
  8. LINE *lp;
  9. {
  10.   register int nicol, i;
  11.   int c;
  12.   
  13.   nicol = 0;
  14.   while (n--) 
  15.   {
  16.     nicol = 0;
  17.     for (i = 0; i < llength(lp); ++i) 
  18.     {
  19.       c = lgetc(lp, i);
  20.       if ((c != ' ') && (c != '\t'))
  21.         break;
  22.       if (c == '\t')
  23.         nicol |= TABROUND;   
  24.       ++nicol;
  25.     }
  26.   }
  27.   return(nicol);
  28. }
  29.  
  30. /* Sigh, as yet unimplemented code
  31. */
  32. int indentthisline(lp)
  33. LINE *lp;
  34. {
  35.  int foo;
  36. #ifdef INDENTING
  37.   foo = indentofline(1, curwp->w_dotp);
  38. #else
  39.   foo = 4;
  40. #endif
  41.   return (foo);
  42. }
  43.